package com.teach;

import java.util.Random;

public class RandomTest {

	public static void main(String[] args) {
		Random r = new Random();
		r = new Random(1000L);//初始化种子
		for(int i=0;i<100;i++){
//			System.out.println(r.nextFloat()); //0<=value<1
//			System.out.println(r.nextDouble());//0<=value<1
//			System.out.println(r.nextLong());//Long.MIN_VALUE Long.MAX_VALUE
//			System.out.println(r.nextInt());//Integer.MIN_VALUE Integer.MAX_VALUE
//			System.out.println(r.nextInt(10));//0<=value<MAX
//			System.out.println(r.nextBoolean());
//			System.out.println(r.nextGaussian());//高斯随机 越接近0的数出现次数越多
			
			//模拟大家的成绩，范围 50-100，成绩主要集中在80分上下
			
//			System.out.println(r.nextInt(100-50+1)+50);//成绩平均分布
			
			double gs = r.nextGaussian()*10;
			int ret = (int)Math.round(gs+80); //四舍五入，方法名是什么？以什么字母开始
			if(ret>100){
				ret = 100;
			}
			if(ret<50){
				ret =50;
			}
			System.out.println(ret);
		}
	}
}
